package top.zlcode.ai.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.zlcode.ai.service.IChatService;
import top.zlcode.api.ai.domain.dto.ChatDTO;
import top.zlcode.api.ai.domain.vo.ChatVO;
import top.zlcode.common.core.domain.R;

@RestController
@RequestMapping("/chat")
public class ChatController {

    @Autowired
    @Qualifier("ChatDeekSeekService")
    private IChatService chatService;

    /**
     * 简单问答接口, 可以自行拼接历史对话
     */
    @PostMapping("/ask")
    public R<ChatVO> ask(@RequestBody ChatDTO chatDTO){
        return chatService.ask(chatDTO);
    }
}
